﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

class EndGameBase : EnvBase

    
{

    private List<Animation> cutsceneFrames;

    private int currentFrame;
    private EnvBase m_target;

    public EndGameBase(EnvBase target)
    {
        this.m_target = target;
        init();
    }

    private void init()
    {
        currentFrame = 0;
        cutsceneFrames = new List<Animation>();

    }

    private void propagateCutsceneFrames()
    {
        //cutsceneFrames.Add(new Animation("cutsceneFrame1", 0, false));
    }

    private void goToNextFrame()
    {
        currentFrame++;
        if (currentFrame > (cutsceneFrames.Count-1))
        {
            animComplete();
        }
    }

    private void animComplete()
    {
        m_parentStack.popOnce(m_target);
    }

    public override void render()
    {
        cutsceneFrames[currentFrame].render(new Vector2(0, 0));
    }

    public override void update(double dt)
    {


        // listen for controls
        if (InputManager.getSingleton().getControlState(InputManager.JUMP_BUTTON))
        {
            goToNextFrame();
        }
    }
}